package edu.ncsu.csc.ip.client.run;

import java.io.IOException;

import edu.ncsu.csc.ip.client.PeerClient;
import edu.ncsu.csc.ip.client.protocol.ProtocolClientImpl;

public class RunScenario {

	
	public static void main(String[] args) throws IOException {

		PeerClient peerA = new PeerClient("127.0.0.1", 65423, 65451, "./rfc_a/");
		PeerClient peerB = new PeerClient("127.0.0.1", 65423, 65452, "./rfc_b/");
		
		//1
		peerA.runCommand(ProtocolClientImpl.REGISTER);
		peerB.runCommand(ProtocolClientImpl.REGISTER);
		
		//2
		peerA.runCommand(ProtocolClientImpl.PQUERY);
		peerA.runCommand(ProtocolClientImpl.RFCQUERY);
		peerA.runCommand(ProtocolClientImpl.GETRFC+" 7013");
		
		//3 
		peerB.runCommand(ProtocolClientImpl.LEAVE);
		
		//4
		peerA.runCommand(ProtocolClientImpl.PQUERY);
		peerA.runCommand(ProtocolClientImpl.RFCQUERY);
		peerA.runCommand(ProtocolClientImpl.GETRFC+" 7008");
		
		//5
		peerA.runCommand(ProtocolClientImpl.LEAVE);
		
		System.exit(0);
		
	}
}
